package com.tjise.test;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.vod.model.v20170321.GetPlayInfoRequest;
import com.aliyuncs.vod.model.v20170321.GetPlayInfoResponse;
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest;
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse;

/**
 * @program: tjise_shixun
 * @description: 获取视频的播放凭证
 * @author: 郑朝文
 * @create: 2021-06-25 17:24
 **/
public class AuthorVod {
    public static void main(String[] args) throws ClientException {
        // 初始化
        DefaultAcsClient defaultAcsClient = Test.initVodClient("LTAI5tEhgZLnTYiJcR14ue4k", "uKUoB4MuhHNMuFBO4D39qDWNRGqZfj");
        // 创建request对象
        GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();

        // 通过视频id获取
        request.setVideoId("5c3a3bd7221647be8dc19152fd6b36b6");
        // 调用getAcsResponse() 方法返回
        GetVideoPlayAuthResponse response = defaultAcsClient.getAcsResponse(request);
        // 获取凭证
        System.out.println(response.getPlayAuth());


    }
}


